SetGfxDriver 1:Graphics 64,64,8,2:SeedRnd MilliSecs() :SetBuffer FrontBuffer() 

nums = CreateBank(4096):numw = CreateBank(4096)
For i = 0 To 4096 
t = Rand(0,255):PokeByte nums,i, t:PokeByte numw,i, t
Next 

While Not KeyHit(1) 
Cls  

For i = 0 To 4096 
ttt=PeekByte(nums,i)
If ttt>127 Then PokeByte nums,i,mod1((PeekByte (nums,mod2(i+7))Xor 128)) :PokeByte(nums,mod2(i+1),ttt)
Next 
;If PeekByte (nums,4096)>127 ttt= PeekByte (nums,4096):PokeByte nums,4096,((PeekByte(nums,0)+1) Mod 255):PokeByte(nums,0,ttt)


For i1=63 To 0 Step -1
For i=63 To 0 Step -1
;If PeekByte(nums,i*64+i1)>127 Color 0,255,0:Text i*16,i1*9+9,PeekByte(nums,i*64+i1),False ,False Else Color 0, PeekByte(nums,i*64+i1),0:Text i*16,i1*9+9,PeekByte(nums,i*64+i1),False ,False
;If PeekByte(nums,i*64+i1)>127 Color 0,255,0:Text i*6,i1*6+9,Chr(1),False ,False Else Color 0, PeekByte(nums,i*64+i1),0:Text i*6,i1*6+9,Chr(1),False ,False
If PeekByte(nums,i*64+i1)>127 Color 0,255,0:Plot i,i1 Else Color 0, PeekByte(nums,i*64+i1),0:Plot i,i1


Text 10,700,mod2(4097),False ,False
Next
Next

Flip 

If KeyHit(57) > 0 WaitMouse()
Wend 

Function mod2(modx)
If modx<0 Return modx=4095-modx Else If modx>4095 Return (modx - 4096)
Return modx
End Function

Function mod1(modx)
If modx<0 Return modx=255-modx Else If modx>255 Return (modx -256)
Return modx
End Function